<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>系统消息</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav white fs_xl">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title fs_xl">系统消息</h1>
		</header>
		<div class="mui-content xt_h fs_xl">
			<div class="xt_top">
				<ul class="cls">
<!-- 					<span class="mui-badge">{$message_count}</span> -->
<!-- 					<li class="active">通知<if condition="$informCount gt 0">({$informCount})</if></li> -->
<!-- 					<li>物流<if condition="$shppingMessageCount gt 0">({$shppingMessageCount})</if></li> -->
						<li class="active"><span class="fs_l">通知</span><if condition="$informCount gt 0"><span class="mui-badge">{$informCount}</span></if></li>
					<li><span class="fs_l">物流</span><if condition="$shppingMessageCount gt 0"><span class="mui-badge">{$shppingMessageCount}</span></if></li>
				</ul>
			</div>
			<div class="xt_box">
				<div   class="xt_list active">
					<ul>
						<volist name="messsgelist"  id="vo">
							<if condition ="$vo.umcategory gt 0">
								<li>
									<a <if empty($vo.url)>href="javascript:void(0)"<else />href="{$vo.url}" </if> <if $vo.status == 1>class="active"</if>  class="is_check" onclick="msgCheck($(this))" url="{$vo.url}" is_check="{$vo.status}" rec_id="{$vo.rec_id}">
										<p class="mui-table-view-cell"><span class="mui-navigate-right fs_l">{$vo.title}</span></p>
										<p class="not_p fs_m" >{$vo.message}</p>
										<p class="ntime_p fs_xs">{$vo.send_time|date="Y-m-d H:i",###}</p>
									</a>
								</li>
							</if>
						</volist>
					</ul>
				</div>
				<div class="xt_list">
					<ul>
						<volist name="messsgelist"  id="vo">
							<if condition ="$vo.umcategory == 0">
								<li>
									<a <if empty($vo.url)>href="javascript:void(0)"<else />href="{$vo.url}" </if> <if $vo.status == 1>class="active"</if>  class="is_check" onclick="msgCheck($(this))" url="{$vo.url}" is_check="{$vo.status}" rec_id="{$vo.rec_id}">
										<p class="mui-table-view-cell"><span class="mui-navigate-right fs_l">{$vo.title}</span></p>
										<p class="not_p fs_m" >{$vo.message}</p>
										<p class="ntime_p fs_xs">{$vo.send_time|date="Y-m-d H:i",###}</p>
										
<!-- 										<div class="xt_li_t cls"><span class="fs_l">{$vo.title}</span><span class="fs_xs">{$vo.send_time|date="Y-m-d H:i",###}</span></div> -->
<!-- 										<div class="xt_li_m cls"> -->

<!-- 											<div class="xt_li_info"> -->
<!-- 												<p class="fs_s">{$vo.message}</p> -->
<!-- 											</div> -->
<!-- 										</div> -->
									</a>
								</li>
							</if>
						</volist>
					</ul>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			mui.init();
			$(function() {
				$(".xt_top li").click(function() {
					$(".xt_top li").removeClass("active").eq($(".xt_top li").index(this)).addClass("active");
					$(".xt_list").hide().eq($('.xt_top li').index(this)).show();
				});
				$(".xt_list li a").click(function() {
					$(this).find("*").css("color", "#ddd");
				});
			})
			
			function msgCheck(ms){
				var url = ms.attr("url");
				var rec_id= ms.attr("rec_id");
				var is_check = ms.attr("is_check");
				//已查看
				if(is_check == 1){
					if(url=='' ||　url=='undefined'){
					    return false;
					}
					else{
						location.href = url;
					}
				}else{
					$.ajax({
						type:"POST",
						url:"/Mobile/User/messageCheck",
						data:{"rec_id":rec_id},
						dataType:"json",
						async:false,//同步操作
						success:function(data){
							if(data.status == 1){
							   location.reload();
							}
						}
					});
				}
			}
		</script>
	</body>

</html>